package com.scholarship.common.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 列表返回数据
 * @Author Z.J.H
 * @create 2021/5/26 10:40
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultListDto<T> {
    private Long total;  //数据总量
    private List<T> list;   //返回数据

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("ResultListDto{\ntotal=");
        sb.append(total);
        sb.append(",\nlist=\n");
        for(T obj : list) {
            sb.append(obj.toString());
            sb.append("\n");
        }
        sb.append("}");
        return sb.toString();
    }
}
